﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ValidateTest.aspx.cs" Inherits="Chart.ValidateTest" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script src="../Scripts/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.mousewheel.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="../Scripts/globalize.js" type="text/javascript"></script>
<script src="../Scripts/globalize.culture.de-DE.js" type="text/javascript"></script>
<script src="../Scripts/highcharts.js" type="text/javascript"></script>
<link rel="stylesheet" href="../Styles/jquery-ui.css">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <script>
 function GetTodayString() {
 var today = new Date();
              var month = today.getMonth() + 1;
              var strMonth;
              if (month < 10) {
                  strMonth = "0" + month;
              }
              else {
                  strMonth = month;
              }
              var strtoday = today.getFullYear() + "-" + strMonth + "-" + today.getDate();
              return strtoday; 

 }

 $(function () {
     $("#Fromdatepicker").datepicker();
     $("#Fromdatepicker").datepicker("option", "dateFormat", "yy-mm-dd");
     $("#Fromdatepicker").val(GetTodayString());


     $("#Todatepicker").datepicker();
     $("#Todatepicker").datepicker("option", "dateFormat", "yy-mm-dd");
 });

  </script>

  <script>
      $.widget("ui.timespinner", $.ui.spinner, {
          options: {
              // seconds
              step: 60 * 1000,
              // hours
              page: 60
          },

          _parse: function (value) {
              if (typeof value === "string") {
                  // already a timestamp
                  if (Number(value) == value) {
                      return Number(value);
                  }
                  return +Globalize.parseDate(value);
              }
              return value;
          },

          _format: function (value) {
              return Globalize.format(new Date(value), "t");
          }
      });

      $(function () {
          Globalize.culture("de-DE");
          $("#spinnerTimeFrom").timespinner();
          $("#spinnerTimeTo").timespinner();
      });
  </script>
  <script>

      $().ready(function () {
          // validate signup form on keyup and submit
          $("#chartForm").validate({
              rules: {
                  RBar: { number: true },
                  Fromdatepicker: { date: true, required: true }

              }

          });

          $("#submit").click(function () {
              alert("aaa");
              alert(GetTodayString());
              alert($("#Fromdatepicker").val());
          });
      });


  </script>
    <div>
    <label>Date From:</label>
    <input type="text" id="Fromdatepicker" name= "Fromdatepicker" value="2014-09-08" />
    <label id="labelTodatepicker">Date To:</label>
    <input type="text" id="Todatepicker" />
    </div>

    <div>
    <label>Time From:</label>
    <input id="spinnerTimeFrom" name="spinnerTimeFrom" value="00:00" style="width:50%"/>
    <label>Time To:</label>
    <input id="spinnerTimeTo" name="spinnerTimeTo" value="23:59" style="width:50%"/>
    <label>R-Bar:</label>
    <input type="text" name="RBar" id="RBar"/>
    </div>
    <div>
    <input type="button" value="submit" id ="submit"/>
    </div>
</asp:Content>
